<!doctype html>
<%@ page contentType="text/html;charset=utf-8" pageEncoding="utf-8"
         language="java" %>
<%@ include file="/jsp/mobile/include/include.jsp" %>
<html lang="cn">
<head>
    <%@ include file="/jsp/mobile/include/header.jsp" %>
    <title>扫码支付</title>
    
</head>
<body class="nobg">
<%-- <div class="head">
    <div class="auto">
        <span class="tit">扫码收款</span> <a href="<%=request.getContextPath()%>/mobile/index/incomefirst" class="ico retu"></a>
    </div>
</div> --%>
<div class="main">
    <div class="sma">
        <div class="sem">
            <p class="red f18 fb">
                ￥<fmt:formatNumber pattern="#,##0.00" value="${amount}"/>
            </p>

            <p class="mt15 mnn">
                <img src="${codeImgUrl}"/>
            </p>

            <p class="mt10 f16">扫二维码，完成付款</p>
            <c:if test="${'2'== payChannel}">
            <p>（使用微信扫一扫）</p>
            </c:if>
            <c:if test="${'1'== payChannel}">
            <p>（使用支付宝扫一扫）</p>
            </c:if>
        </div>
        <div id="sendBit" class="nbtn mt40">
        	<a class="butn" href="javascript:saveBitMatrix('<c:out value="${codeImageUrl}"/>');">保存至相册本机扫码</a><br>
            <%-- <a class="butn" href="javascript:shareBitMatrix('<c:out value="${codeImageUrl}"/>');">发送付款码远程收款</a> --%>
        </div>
    </div>
</div>

</body>


<script type="text/javascript">
   /*  function shareBitMatrix(url)
    {
       window.jsInjectedObj.shareBitMatrix(url);
    } */
    
    function saveBitMatrix(url)
    {
       window.jsInjectedObj.saveBitMatrix(url);
    }


    $(document).ready(function() {
        setInterval('queryOrderStatus()', 1000 * 10);
    });

    function queryOrderStatus() {
        $.ajax({
            type: "GET",
            url: "<%=request.getContextPath()%>/mobile/index/queryOrderStatus",
            data:
            {
                'orderId' : '<c:out value="${orderId}"/>'
            },
            dataType: "json",
            success: function(msg) {
                if (msg.transStatus == "S") {
                    window.location.href = "<%=request.getContextPath()%>/mobile/index/incomesign";
                }

                if (msg.transStatus == "F") {
                    window.location.href = "<%=request.getContextPath()%>/mobile/index/incomefail";
                }
            }
        });
    }
</script>
</html>